package com.liuya.safe.user.service;

import com.liuya.base.BaseService;
import com.liuya.safe.model.SafePrivilege;
import com.liuya.safe.model.SafeUserRole;

import java.util.Collection;

public interface UserRoleManagerService extends BaseService<SafeUserRole> {

    public void assignRoles(String userId, Collection roleIds);

    public void assignRoles(Collection userIds, Collection roleIds);

    /**
     * return Collection< Role >
     *
     * @param userId
     * @return
     */
    public Collection getRoles(Object userId);

    /**
     * delete user's roles
     *
     * @param userId
     */
    public void deleteUserRoles(Object userId);

    public boolean hasPrivilege(Object userId, String pvlgId);

    /**
     * when delete a role, delete related user-role records
     *
     * @param roleId
     */
    public void deleteUserRoles(String roleId);

    /**
     * Get current user's menu
     *
     * @param userId
     * @return
     */
    public SafePrivilege getBusinessPrivilegeTree(Object userId);
}
